package atlub.tweet_crawler;

import java.util.ArrayList;
import java.util.List;

public class CredentialsRoundrobin implements ICredentials{

    String ck = "fkyFWec90mrtO0On4cBEQ"; //PghTwit
    String cs = "ePEfjpymYbfACWSCaGOZ6BC8uuqBDz6Gs2GK3HIjA";
    
    List<String> user_access_tokens= new ArrayList<String>();
    List<String> user_access_secrets = new ArrayList<String>();
    int ptr = -1;
    
    public CredentialsRoundrobin(){
	addUser("155763791-p8ha3ONvwJ5tk5CZqZ0qJVSIbqc8NyQAMcYVHTy3", "fvmehYnJbcykMwbWGG1Itpg2w4HEUHYloZJpkmiY"); //korolevbin
	addUser("259592339-0K2Ltrg6TbAss9CFcr846zSWQewMlzJtJ3RZvXyS", "YNFMg3SGyOJmG3OpmObjcZFs2APL541rx2haOXcaEUo");//twimightmode
	addUser("517305373-vgdCUb73AS3wRZayTLKksZjM3Eiq3VZ3aPkhLEz9", "kMYk8mbYlrLSYahEofLgQopn2HW1IYUoetWRF41vTQA");//Daisy_YZM
	addUser("133646210-0qF0MXo6nxMOLapAVXkC6JO3wA7jS6oyFrYjJj4z", "F6NQIutPgOnCi2x7oZHvxAlUVjUdSt1WVhBTEhWc50E");//korolevbin2
	addUser("21210242-mdDwoK7Ckthnpsa2oxgqXegbjdbEu3W71s10r1VrA", "bhwfyBs988wxyXtLZOh7902OuRuulyKTc0CWENqVE");//menphix
	addUser("22227156-WLhw0vd2dq5A8OTOelCYr28VAIeBxnyHuGjoOV1jI", "zFcghZUyCvRikElI7Smt7TSSyscLdk4vHxtKd3QOfHk");//sunnywanwan
	addUser("961624220-z1a0LFU4SZjogPwwOMEwLZxwHcCBfV8HKrhESBvV", "cuOntoHZt3al0gFcLzU7XiFcxrBVfjlVMCHQAKRvE");//DavidTao9
	addUser("961629188-OgpzfDjkrqJAjgD6VPB3Kr8q1lxW37PaSKFEZWWQ", "SrgBHZvU28OSDVPTYaKioCx8eJEzl26yd7OHQtL6s");//Yuchenz_cmu
    }
    void addUser(String at, String as){
	user_access_tokens.add(at);
	user_access_secrets.add(as);
    }
    
    @Override
    public int getCredentialCount() {
	return user_access_tokens.size();
    }

    @Override
    public String[] getCredential() {
	ptr = (ptr + 1) % user_access_tokens.size();
	return new String[]{ck, cs, user_access_tokens.get(ptr), user_access_secrets.get(ptr)};
    } 
}
